<#assign className = table.className>   
<#assign classNameLower = className?uncap_first> 
package ${basepackage}.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
<#include "/java_imports.include">

@Service
public class ${className}Service extends DefaultService<${className}, ${table.pkColumn.simpleJavaType}>{

	private ${className}Mapper ${classNameLower}Mapper;

	@Autowired
	public void set${className}Mapper(${className}Mapper ${classNameLower}Mapper) {
		this.${classNameLower}Mapper = ${classNameLower}Mapper;
	}

	@Override
	@Transactional(readOnly = true)
	public Page<${className}> findPage(PageRequest pr) {
		return ${classNameLower}Mapper.findPage(pr);
	}
	
	<#list table.columns as column>
	<#if column.unique && !column.pk>
	@Transactional(readOnly = true)
	public ${className} getBy${column.name}(${column.javaType} v) {
		return ${classNameLower}Mapper.getBy${column.name}(v);
	}	
	</#if>
	</#list>
}